#include <bits/stdc++.h>

using namespace std;

int a,b,x,y;

int main (){
	cin>>a>>b>>x>>y;
	int ans;
	if(a > b){
		ans = x + min(2*x,y) * (a-b-1);
	}else if(a == b){
		ans = x;
	}else {
		ans = x + min(2*x,y) * (b-a);
	}cout<<ans;
}
